-
Notifications
You must be signed in to change notification settings - Fork 13.4k
metal : remove memory pools #15966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
metal : remove memory pools #15966
Conversation
cfe86b2 to
25e82c9
Compare
|
@slaren The trick with expanding the allocated size of the tensors seems to work without any problems. Let me know if you have any additional thoughts about utilizing this approach. |
ggml-ci
ggml-ci
ggml-ci
3bc8fd4 to
158526e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I suppose there could be an issue where the extra data is not aligned in some cases, but since these operations always return F32, I guess it will always be aligned to at least 4 bytes. Not sure if there could an advantage to using a larger alignment.
ref #15832 (comment)
Instead of allocating buffers from
MTLHeapwe expand thedsttensors with enough space to write the necessary scratch data.TODO:
get_alloc_sizesizes in-sync with the actual implementation (Edit: use simple functions to get the extra sizes)ggml_mem_rangesinstead of just usingggml_nbytes